package com.example.cafe.work.controller;


import com.example.cafe.work.dto.Result;
import com.example.cafe.work.model.Ticket;
import com.example.cafe.work.service.TicketService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hua
 * @since 2024-09-16
 */
@RestController
@RequestMapping("/ticket")
public class TicketController {
    @Autowired
    TicketService ticketService;

    @PostMapping("/add")
    public Result addVoucher(@RequestBody Ticket ticket) {
        return ticketService.add(ticket);
    }

    @RequestMapping("selectAll")
    public Result queryVoucher(){
        return ticketService.selectAll();
    }

}

